SLASH_FALIGN1 = "/align"

SlashCmdList["FALIGN"] = function()
	if fAlign then
		fAlign:Hide()
		fAlign = nil		
	else
		fAlign = CreateFrame('Frame', nil, UIParent) 
		fAlign:SetAllPoints(UIParent)
		local w = GetScreenWidth() / 64
		local h = GetScreenHeight() / 36
		for i = 0, 64 do
			local tAlign = fAlign:CreateTexture(nil, 'BACKGROUND')
			if i == 32 then
				tAlign:SetTexture(1, 0, 0, 0.5)
			else
				tAlign:SetTexture(0, 0, 0, 0.5)
			end
			tAlign:SetPoint('TOPLEFT', fAlign, 'TOPLEFT', i * w - 1, 0)
			tAlign:SetPoint('BOTTOMRIGHT', fAlign, 'BOTTOMLEFT', i * w + 1, 0)
		end
		for i = 0, 36 do
			local tAlign = fAlign:CreateTexture(nil, 'BACKGROUND')
			if i == 18 then
				tAlign:SetTexture(1, 0, 0, 0.5)
			else
				tAlign:SetTexture(0, 0, 0, 0.5)
			end
			tAlign:SetPoint('TOPLEFT', fAlign, 'TOPLEFT', 0, -i * h + 1)
			tAlign:SetPoint('BOTTOMRIGHT', fAlign, 'TOPRIGHT', 0, -i * h - 1)
		end	
	end
end